Optimal. Leaf size=145 \[ -\frac {\left (-a b e-a c d+b^2 d\right ) \log \left (a+b x+c x^2\right )}{2 a^3}+\frac {\log (x) \left (-a b e-a c d+b^2 d\right )}{a^3}+\frac {b d-a e}{a^2 x}+\frac {\left (2 a^2 c e-a b^2 e-3 a b c d+b^3 d\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{a^3 \sqrt {b^2-4 a c}}-\frac {d}{2 a x^2} \]
________________________________________________________________________________________
Rubi [A] time = 0.23, antiderivative size = 145, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {800, 634, 618, 206, 628} \begin {gather*} -\frac {\left (-a b e-a c d+b^2 d\right ) \log \left (a+b x+c x^2\right )}{2 a^3}+\frac {\log (x) \left (-a b e-a c d+b^2 d\right )}{a^3}+\frac {\left (2 a^2 c e-a b^2 e-3 a b c d+b^3 d\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{a^3 \sqrt {b^2-4 a c}}+\frac {b d-a e}{a^2 x}-\frac {d}{2 a x^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 618
Rule 628
Rule 634
Rule 800
Rubi steps
\begin {align*} \int \frac {d+e x}{x^3 \left (a+b x+c x^2\right )} \, dx &=\int \left (\frac {d}{a x^3}+\frac {-b d+a e}{a^2 x^2}+\frac {b^2 d-a c d-a b e}{a^3 x}+\frac {-b^3 d+2 a b c d+a b^2 e-a^2 c e-c \left (b^2 d-a c d-a b e\right ) x}{a^3 \left (a+b x+c x^2\right )}\right ) \, dx\\ &=-\frac {d}{2 a x^2}+\frac {b d-a e}{a^2 x}+\frac {\left (b^2 d-a c d-a b e\right ) \log (x)}{a^3}+\frac {\int \frac {-b^3 d+2 a b c d+a b^2 e-a^2 c e-c \left (b^2 d-a c d-a b e\right ) x}{a+b x+c x^2} \, dx}{a^3}\\ &=-\frac {d}{2 a x^2}+\frac {b d-a e}{a^2 x}+\frac {\left (b^2 d-a c d-a b e\right ) \log (x)}{a^3}-\frac {\left (b^2 d-a c d-a b e\right ) \int \frac {b+2 c x}{a+b x+c x^2} \, dx}{2 a^3}-\frac {\left (b^3 d-3 a b c d-a b^2 e+2 a^2 c e\right ) \int \frac {1}{a+b x+c x^2} \, dx}{2 a^3}\\ &=-\frac {d}{2 a x^2}+\frac {b d-a e}{a^2 x}+\frac {\left (b^2 d-a c d-a b e\right ) \log (x)}{a^3}-\frac {\left (b^2 d-a c d-a b e\right ) \log \left (a+b x+c x^2\right )}{2 a^3}+\frac {\left (b^3 d-3 a b c d-a b^2 e+2 a^2 c e\right ) \operatorname {Subst}\left (\int \frac {1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{a^3}\\ &=-\frac {d}{2 a x^2}+\frac {b d-a e}{a^2 x}+\frac {\left (b^3 d-3 a b c d-a b^2 e+2 a^2 c e\right ) \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{a^3 \sqrt {b^2-4 a c}}+\frac {\left (b^2 d-a c d-a b e\right ) \log (x)}{a^3}-\frac {\left (b^2 d-a c d-a b e\right ) \log \left (a+b x+c x^2\right )}{2 a^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.13, size = 141, normalized size = 0.97 \begin {gather*} \frac {\frac {2 \left (-2 a^2 c e+a b^2 e+3 a b c d+b^3 (-d)\right ) \tan ^{-1}\left (\frac {b+2 c x}{\sqrt {4 a c-b^2}}\right )}{\sqrt {4 a c-b^2}}-\frac {a^2 d}{x^2}+2 \log (x) \left (-a b e-a c d+b^2 d\right )+\left (a b e+a c d+b^2 (-d)\right ) \log (a+x (b+c x))+\frac {2 a (b d-a e)}{x}}{2 a^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {d+e x}{x^3 \left (a+b x+c x^2\right )} \, dx \end {gather*}
Verification is not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.83, size = 517, normalized size = 3.57 \begin {gather*} \left [\frac {\sqrt {b^{2} - 4 \, a c} {\left ({\left (b^{3} - 3 \, a b c\right )} d - {\left (a b^{2} - 2 \, a^{2} c\right )} e\right )} x^{2} \log \left (\frac {2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c + \sqrt {b^{2} - 4 \, a c} {\left (2 \, c x + b\right )}}{c x^{2} + b x + a}\right ) - {\left ({\left (b^{4} - 5 \, a b^{2} c + 4 \, a^{2} c^{2}\right )} d - {\left (a b^{3} - 4 \, a^{2} b c\right )} e\right )} x^{2} \log \left (c x^{2} + b x + a\right ) + 2 \, {\left ({\left (b^{4} - 5 \, a b^{2} c + 4 \, a^{2} c^{2}\right )} d - {\left (a b^{3} - 4 \, a^{2} b c\right )} e\right )} x^{2} \log \relax (x) - {\left (a^{2} b^{2} - 4 \, a^{3} c\right )} d + 2 \, {\left ({\left (a b^{3} - 4 \, a^{2} b c\right )} d - {\left (a^{2} b^{2} - 4 \, a^{3} c\right )} e\right )} x}{2 \, {\left (a^{3} b^{2} - 4 \, a^{4} c\right )} x^{2}}, \frac {2 \, \sqrt {-b^{2} + 4 \, a c} {\left ({\left (b^{3} - 3 \, a b c\right )} d - {\left (a b^{2} - 2 \, a^{2} c\right )} e\right )} x^{2} \arctan \left (-\frac {\sqrt {-b^{2} + 4 \, a c} {\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) - {\left ({\left (b^{4} - 5 \, a b^{2} c + 4 \, a^{2} c^{2}\right )} d - {\left (a b^{3} - 4 \, a^{2} b c\right )} e\right )} x^{2} \log \left (c x^{2} + b x + a\right ) + 2 \, {\left ({\left (b^{4} - 5 \, a b^{2} c + 4 \, a^{2} c^{2}\right )} d - {\left (a b^{3} - 4 \, a^{2} b c\right )} e\right )} x^{2} \log \relax (x) - {\left (a^{2} b^{2} - 4 \, a^{3} c\right )} d + 2 \, {\left ({\left (a b^{3} - 4 \, a^{2} b c\right )} d - {\left (a^{2} b^{2} - 4 \, a^{3} c\right )} e\right )} x}{2 \, {\left (a^{3} b^{2} - 4 \, a^{4} c\right )} x^{2}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.18, size = 152, normalized size = 1.05 \begin {gather*} -\frac {{\left (b^{2} d - a c d - a b e\right )} \log \left (c x^{2} + b x + a\right )}{2 \, a^{3}} + \frac {{\left (b^{2} d - a c d - a b e\right )} \log \left ({\left | x \right |}\right )}{a^{3}} - \frac {{\left (b^{3} d - 3 \, a b c d - a b^{2} e + 2 \, a^{2} c e\right )} \arctan \left (\frac {2 \, c x + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{\sqrt {-b^{2} + 4 \, a c} a^{3}} - \frac {a^{2} d - 2 \, {\left (a b d - a^{2} e\right )} x}{2 \, a^{3} x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.07, size = 273, normalized size = 1.88 \begin {gather*} -\frac {2 c e \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, a}+\frac {b^{2} e \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, a^{2}}+\frac {3 b c d \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, a^{2}}-\frac {b^{3} d \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, a^{3}}-\frac {b e \ln \relax (x )}{a^{2}}+\frac {b e \ln \left (c \,x^{2}+b x +a \right )}{2 a^{2}}-\frac {c d \ln \relax (x )}{a^{2}}+\frac {c d \ln \left (c \,x^{2}+b x +a \right )}{2 a^{2}}+\frac {b^{2} d \ln \relax (x )}{a^{3}}-\frac {b^{2} d \ln \left (c \,x^{2}+b x +a \right )}{2 a^{3}}-\frac {e}{a x}+\frac {b d}{a^{2} x}-\frac {d}{2 a \,x^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 2.49, size = 814, normalized size = 5.61 \begin {gather*} \frac {\ln \left (6\,a^3\,c^2\,d-2\,a^2\,b^3\,e+2\,a\,b^4\,d+2\,b^5\,d\,x+7\,a^3\,b\,c\,e-2\,a\,b^4\,e\,x+2\,a\,b^3\,d\,\sqrt {b^2-4\,a\,c}+a^3\,c\,e\,\sqrt {b^2-4\,a\,c}+2\,b^4\,d\,x\,\sqrt {b^2-4\,a\,c}-9\,a^2\,b^2\,c\,d-2\,a^3\,c^2\,e\,x-2\,a^2\,b^2\,e\,\sqrt {b^2-4\,a\,c}-2\,a\,b^3\,e\,x\,\sqrt {b^2-4\,a\,c}+9\,a^2\,b\,c^2\,d\,x+8\,a^2\,b^2\,c\,e\,x+3\,a^2\,c^2\,d\,x\,\sqrt {b^2-4\,a\,c}-10\,a\,b^3\,c\,d\,x-3\,a^2\,b\,c\,d\,\sqrt {b^2-4\,a\,c}-6\,a\,b^2\,c\,d\,x\,\sqrt {b^2-4\,a\,c}+4\,a^2\,b\,c\,e\,x\,\sqrt {b^2-4\,a\,c}\right )\,\left (a^2\,\left (2\,c^2\,d+2\,b\,c\,e+c\,e\,\sqrt {b^2-4\,a\,c}\right )+\frac {b^4\,d}{2}-a\,\left (\frac {b^3\,e}{2}+\frac {b^2\,e\,\sqrt {b^2-4\,a\,c}}{2}+\frac {5\,b^2\,c\,d}{2}+\frac {3\,b\,c\,d\,\sqrt {b^2-4\,a\,c}}{2}\right )+\frac {b^3\,d\,\sqrt {b^2-4\,a\,c}}{2}\right )}{4\,a^4\,c-a^3\,b^2}-\frac {\ln \relax (x)\,\left (a\,\left (b\,e+c\,d\right )-b^2\,d\right )}{a^3}-\frac {\frac {d}{2\,a}+\frac {x\,\left (a\,e-b\,d\right )}{a^2}}{x^2}+\frac {\ln \left (2\,a^2\,b^3\,e-6\,a^3\,c^2\,d-2\,a\,b^4\,d-2\,b^5\,d\,x-7\,a^3\,b\,c\,e+2\,a\,b^4\,e\,x+2\,a\,b^3\,d\,\sqrt {b^2-4\,a\,c}+a^3\,c\,e\,\sqrt {b^2-4\,a\,c}+2\,b^4\,d\,x\,\sqrt {b^2-4\,a\,c}+9\,a^2\,b^2\,c\,d+2\,a^3\,c^2\,e\,x-2\,a^2\,b^2\,e\,\sqrt {b^2-4\,a\,c}-2\,a\,b^3\,e\,x\,\sqrt {b^2-4\,a\,c}-9\,a^2\,b\,c^2\,d\,x-8\,a^2\,b^2\,c\,e\,x+3\,a^2\,c^2\,d\,x\,\sqrt {b^2-4\,a\,c}+10\,a\,b^3\,c\,d\,x-3\,a^2\,b\,c\,d\,\sqrt {b^2-4\,a\,c}-6\,a\,b^2\,c\,d\,x\,\sqrt {b^2-4\,a\,c}+4\,a^2\,b\,c\,e\,x\,\sqrt {b^2-4\,a\,c}\right )\,\left (a^2\,\left (2\,c^2\,d+2\,b\,c\,e-c\,e\,\sqrt {b^2-4\,a\,c}\right )+\frac {b^4\,d}{2}-a\,\left (\frac {b^3\,e}{2}-\frac {b^2\,e\,\sqrt {b^2-4\,a\,c}}{2}+\frac {5\,b^2\,c\,d}{2}-\frac {3\,b\,c\,d\,\sqrt {b^2-4\,a\,c}}{2}\right )-\frac {b^3\,d\,\sqrt {b^2-4\,a\,c}}{2}\right )}{4\,a^4\,c-a^3\,b^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________